package com.cml.rpc.server;

import com.cml.rpc.publicinterface.BlogService;
import com.cml.rpc.publicinterface.UserService;

/**
 * 服务端入口
 * @author cml
 * @create 2021/7/21 10:14
 */
public class RpcServerMain {
    public static void main(String[] args) {
        UserService userService = new UserServiceImpl();
        BlogService blogService = new BlogServiceImpl();
        //添加服务实现类
        ServiceProvider serviceProvider = new ServiceProvider();
        serviceProvider.putService(userService);
        serviceProvider.putService(blogService);

//        SimpleRpcServer simpleRpcServer = new SimpleRpcServer(serverProvider);
//        simpleRpcServer.start(8877);

        NettyRpcServer nettyRpcServer = new NettyRpcServer(serviceProvider);
        nettyRpcServer.start(8877);
    }
}
